
Section 18.1: Self Join 55 ...................................................................................................................................................
Section 18.2: Dierences between inner/outer joins 56 ...............................................................................................
Section 18.3: JOIN Terminology: Inner, Outer, Semi, Anti.. 59 .......................................................................................
Section 18.4: Left Outer Join 69 .......................................................................................................................................
Section 18.5: Implicit Join 70 ............................................................................................................................................
Section 18.6: CROSS JOIN 71 ...........................................................................................................................................
Section 18.7: CROSS APPLY & LATERAL JOIN 72 ..........................................................................................................
Section 18.8: FULL JOIN 73 ..............................................................................................................................................
Section 18.9: Recursive JOINs 74 ....................................................................................................................................
Section 18.10: Basic explicit inner join 74 ........................................................................................................................
Section 18.11: Joining on a Subquery 75 .........................................................................................................................
Chapter 19: UPDATE 76 ...................................................................................................................................................
Section 19.1: UPDATE with data from another table 76 ................................................................................................
Section 19.2: Modifying existing values 77 .....................................................................................................................
Section 19.3: Updating Specified Rows 77 ......................................................................................................................
Section 19.4: Updating All Rows 77 .................................................................................................................................
Section 19.5: Capturing Updated records 77 .................................................................................................................
Chapter 20: CREATE Database 78 ............................................................................................................................
Section 20.1: CREATE Database 78 .................................................................................................................................
Chapter 21: CREATE TABLE 79 ....................................................................................................................................
Section 21.1: Create Table From Select 79 .....................................................................................................................
Section 21.2: Create a New Table 79 ..............................................................................................................................
Section 21.3: CREATE TABLE With FOREIGN KEY 79 .....................................................................................................
Section 21.4: Duplicate a table 80 ...................................................................................................................................
Section 21.5: Create a Temporary or In-Memory Table 80 ..........................................................................................
Chapter 22: CREATE FUNCTION 82 ...........................................................................................................................
Section 22.1: Create a new Function 82 ..........................................................................................................................
Chapter 23: TRY/CATCH 83 ..........................................................................................................................................
Section 23.1: Transaction In a TRY/CATCH 83 ..............................................................................................................
Chapter 24: UNION / UNION ALL 84 .......................................................................................................................
Section 24.1: Basic UNION ALL query 84 ........................................................................................................................
Section 24.2: Simple explanation and Example 85 .......................................................................................................
Chapter 25: ALTER TABLE 86 ......................................................................................................................................
Section 25.1: Add Column(s) 86 .......................................................................................................................................
Section 25.2: Drop Column 86 .........................................................................................................................................
Section 25.3: Add Primary Key 86 ..................................................................................................................................
Section 25.4: Alter Column 86 .........................................................................................................................................
Section 25.5: Drop Constraint 86 ....................................................................................................................................
Chapter 26: INSERT 87 ....................................................................................................................................................
Section 26.1: INSERT data from another table using SELECT 87 .................................................................................
Section 26.2: Insert New Row 87 .....................................................................................................................................
Section 26.3: Insert Only Specified Columns 87 ............................................................................................................
Section 26.4: Insert multiple rows at once 87 ................................................................................................................
Chapter 27: MERGE 88 ....................................................................................................................................................
Section 27.1: MERGE to make Target match Source 88 ...............................................................................................
Section 27.2: MySQL: counting users by name 88 ........................................................................................................
Section 27.3: PostgreSQL: counting users by name 88 ................................................................................................
Chapter 28: cross apply, outer apply 90 ..............................................................................................................
Section 28.1: CROSS APPLY and OUTER APPLY basics 90 ...........................................................................................